from rest_framework.generics import  ListAPIView
from rest_framework.response import Response
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_page
from django0924.utils import constants
class CacheListAPIView(ListAPIView):
    @method_decorator(cache_page(constants.LIST_PAGE_CACHE_TIME))
    def get(self, request, *args, **kwargs):
        # 自己本身没有，通过super继承
        return super().get(request, *args, **kwargs)
# def login(request):
#     if request.method == 'post':
#         return Response({'token':""})
